#ifndef __MARS_SCENEGRAPH_SPATIAL_H__
#define __MARS_SCENEGRAPH_SPATIAL_H__

namespace SceneGraph
{
	
class Spatial
{
	friend class SceneNode;

public:
									Spatial();
									Spatial( XMVECTOR position,
											 XMVECTOR rotate,
											 XMVECTOR scale );
	virtual							~Spatial();

	void							SetPosition( const XMVECTOR& position );
	void							SetRotate( const XMVECTOR& rotate );
	void							SetScale( const XMVECTOR& scale );
	void							SetNeedUpdate( bool bUpdate );

	const XMVECTOR&					GetPosition() const;
	const XMVECTOR&					GetRotate() const;
	const XMVECTOR&					GetScale() const;
	bool							IsNeedUpdate() const;

private:
	XMVECTOR						m_position;
	XMVECTOR						m_rotate;
	XMVECTOR						m_scale;

	bool							m_bNeedUpdate;
};

inline Spatial::Spatial()
{
	m_position = XMVectorZero();
	m_rotate = XMVectorZero();
	m_scale = XMVectorSet( 1.0f, 1.0f, 1.0f, 1.0f );
}

inline Spatial::Spatial( XMVECTOR position,
						 XMVECTOR rotate,
						 XMVECTOR scale )
	: m_position( position )
	, m_rotate( rotate )
	, m_scale( scale )
	, m_bNeedUpdate( true )
{

}

inline Spatial::~Spatial()
{

}

inline void Spatial::SetPosition( const XMVECTOR& position )
{
	m_position = position;
}

inline void Spatial::SetRotate( const XMVECTOR& rotate )
{
	m_rotate = rotate;
}

inline void Spatial::SetScale( const XMVECTOR& scale )
{
	m_scale = scale;
}

inline void Spatial::SetNeedUpdate( bool bUpdate )
{
	m_bNeedUpdate = bUpdate;
}

inline const XMVECTOR& Spatial::GetPosition() const
{
	return m_position;
}

inline const XMVECTOR& Spatial::GetRotate() const
{
	return m_rotate;
}

inline const XMVECTOR& Spatial::GetScale() const
{
	return m_scale;
}

inline bool Spatial::IsNeedUpdate() const
{
	return m_bNeedUpdate;
}

} // end of namespace SceneGraph

#endif // end of #ifndef __MARS_SCENEGRAPH_SPATIAL_H__